package com.bjtu.ptsite.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * @author Zehao Wang, Junjie Zhang, Yutao Wei
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    /**
     *
     * 0表示成功，1表示失败
     *
     */
    private Integer code;
    /**
     *
     * 提示信息
     *
     */
    private String msg;
    /**
     *
     * 要返回的数据
     *
     */
    private Object data;
    public static Result success() {//增删改响应成功

        return new Result(0, "success", null);
    }
    public static Result success(Object data) {//增删改响应成功

        return new Result(0, "success", data);
    }
    public static Result error(String msg) {//增删改响应成功

        return new Result(1, msg, null);
    }

}
